<?php
namespace jy_cong2fan;
defined('BY_JYA') or exit('error');
/*
	任务
*/
class task extends \plugin{
    public function jifen_sf($setting=array()){
		if($setting){
			$this->setting=$setting;
		}
        if(!$this->setting['is_open']){
            return false;
        }
		$this->model('model')->up_redfee();
        $daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
        $fanlogs = $this->pdo_getall('fanlog',array('uniacid'=>$_SESSION['uniacid'],'lastfanfee >'=>0,'uptime <'=>$daytime));
        if(!$fanlogs){
          return false;
        }
        foreach($fanlogs as $item){
			$this->model('commission')->up_fanone($item);
        }
        return true;
    }
}